/********************************************************************************
 *      Copyright:  (C) 2025 lijiahui<2199250859@qq.com>
 *                  All rights reserved.
 *
 *       Filename:  net_client.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(22/04/25)
 *         Author:  lijiahui <2199250859@qq.com>
 *      ChangeLog:  1, Release initial version on "22/04/25 19:38:29"
 *                 
 ********************************************************************************/
#ifndef NET_CLIENT
#define NET_CLIENT

#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <netinet/tcp.h>
#include <sys/time.h>
#include <fcntl.h>
#include <sys/select.h>
#include <sys/poll.h>

#include "pack.h"
#include "logger.h"

typedef struct socket_client{
	char	servip[32];//serve ip
	int		port;//serve port
	int		fd;//socket fd
	int		is_connected;//连接状态，0为未连接，1为已连接
}sock_t;

int socket_client_init(sock_t *sock,char *serv_ip,int prot);
int socket_close(sock_t *sock);
int socket_connect(sock_t *sock);
int socket_check(sock_t *sock);
int socket_sendpack(sock_t *sock);

#endif
